package com.dt.common.validation.impl;

import java.util.HashSet;
import java.util.Set;

import com.dt.common.validation.Violation;
import com.dt.common.validation.itf.RuntimeConfiguration;
import com.dt.common.validation.itf.ValidationContext;

public class DefaultValidationContext implements ValidationContext {

	private Set<Violation> violations = new HashSet<>();

	private RuntimeConfiguration configuration;

	@Override
	public Set<Violation> getViolations() {
		return new HashSet<>(violations);
	}

	public void addViolation(Violation violation) {
		violations.add(violation);
	}

	@Override
	public RuntimeConfiguration getConfiguration() {
		return configuration;
	}

	public void setConfiguration(RuntimeConfiguration configuration) {
		this.configuration = configuration;
	}

}
